package com.tvunetworks.device.extra.service;

import com.tvunetworks.center.common.model.dto.GridDto;
import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.device.extra.model.param.GridDeviceParam;
import com.tvunetworks.device.extra.model.param.GridParam;

import java.io.IOException;

/**
 * @author andy
 * @since 2022/3/23
 **/
public interface GridService {
    /**
     * start
     * @param gridParam param
     * @return r
     * @throws Exception e
     */
    Result<Object> start(GridParam gridParam)throws  Exception;
    /**
     * stop
     * @param gridParam param
     * @return r
     * @throws Exception e
     */
    Result stop(GridParam gridParam) throws Exception;

    /**
     * get status
     * @param gridId gridId
     * @exception Exception  e
     * @return status
     */
    Result<Object> getGridStatus(String gridId) throws  Exception;

    /**
     * add or update
     * @param gridDto dto
     * @return r
     */
    Result<Object> addOrUpdateGrid(GridDto gridDto);

    /**
     * get list
     * @param rids rids ,
     * @param condition condition
     * @return r
     */
    Result getGridList(String rids, String condition);

    /**
     * delete
     * @param rids rids
     * @param targetId targetId
     * @param pairId pairId
     * @return r
     */
    Result delete(String rids,String targetId,String pairId);

    /**
     * pair
     * @param gridParam gridParam
     * @throws IOException e
     * @return r
     */
    Result<Object> pair(GridParam gridParam) throws IOException;

    /**
     * userDevice
     * @param id id
     * @param rid rid
     * @return r
     */
    Result getUserDevice(String id, GridDeviceParam rid);

    /**
     * 移除配对
     * @param rid rid
     * @param targetId targetId
     * @param pairId pairId
     * @return r
     */
    Result removePair(String rid, String targetId, String pairId);
}
